			
            function ComputeTotal() {
    			var total = 0;var gst = 0;var totalgst=0;
                
                // $(".item_total").each(function() {
    			     $("#items").find(".item_total").each(function() {
    			     x = ($(this).val()>0)? $(this).val():0;
    				    total += parseInt(x);
    			      });
                      gst = total * 0.1;
                      totalgst = total + gst;
    			 // $(this).append($("<div></div>").text(number_format(total,2,".",",")));
                $("div#total").text(number_format(total,2,".",","));
                $("div#gst").text(number_format(gst,2,".",","));
                $("div#total-gst").text(number_format(totalgst,2,".",","));
    			};
			
			
	
            $(function(){
 
                $('input[name^=qty]').keyup(function(){
                 
                    var parentRow = $(this).closest('tr');
                       
                    var curprice=parseInt(parentRow.find('.uprice').val());
                    var curqty= this.value;
                    var curtotal=curprice * curqty;
                 
                    parentRow.find('.item_total').val(curtotal);
                    ComputeTotal();
                });
             
            });
            
            
            $(function(){
 
                $('input[name^=uprice]').keyup(function(){
                 
                    var parentRow = $(this).closest('tr');
                       
                    var curqty=parseInt(parentRow.find('.qty').val());
                    var curprice= this.value;
                    var curtotal=curprice * curqty;
                 
                    parentRow.find('.item_total').val(curtotal);
                    ComputeTotal();
                });
             
            });
            
			function test() {
			   // $(".test").live("click",function(){
			       var a = $(this).html();
                   var qty,uprice;
                   //alert(a);
                   ComputeTotal();
			   // })
            }
            

			function numberWithCommas(x) {
				var parts = x.toString().split(".");
				parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
				return parts.join(".");
			}
			////////////////////
			function number_format(number, decimals, dec_point, thousands_sep) {
   
				var n = !isFinite(+number) ? 0 : +number, 
				prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
				sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,
				dec = (typeof dec_point === 'undefined') ? '.' : dec_point,
				s = '',
				toFixedFix = function (n, prec) {
					var k = Math.pow(10, prec);
					return '' + Math.round(n * k) / k;
				};
					// Fix for IE parseFloat(0.55).toFixed(0) = 0;
					s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');
					if (s[0].length > 3) {
						s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
					}
					if ((s[1] || '').length < prec) {
						s[1] = s[1] || '';
						s[1] += new Array(prec - s[1].length + 1).join('0');
					}
					return s.join(dec);
			}
			///////////////////